//
//  BTableViewCell.m
//  纪宇婚礼纪
//
//  Created by dllo on 15/12/21.
//  Copyright © 2015年 LT. All rights reserved.
//

#import "BTableViewCell.h"
#import "UIImageView+WebCache.h"

@interface BTableViewCell ()
@property (nonatomic, retain) UIScrollView *myscro;
@property (nonatomic, retain) NSMutableArray *tupianArray;
@property (nonatomic, retain) UIImageView *tupian;
@property (nonatomic, retain) UIImageView *tupian1;
@property (nonatomic, retain) UIImageView *tupian2;

@property (nonatomic, retain) UILabel *label1;
@property (nonatomic, retain) UILabel *label2;
@property (nonatomic, retain) UILabel *label3;
@property (nonatomic, retain) UILabel *label4;
@property (nonatomic, retain) UILabel *label5;




@end

@implementation BTableViewCell

-(void)dealloc{

    [_tupian release];
    [_tupianArray release];
    [_lunmo release];
    [_myscro release];
    [super dealloc];
}



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self fangfa];
    }
    return self;
}



-(void)fangfa{

    
    self.backgroundColor = [UIColor greenColor];
    self.myscro = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 375, 188)];
    self.myscro.backgroundColor = [UIColor purpleColor];
    [self.contentView addSubview:self.myscro];
    self.myscro.contentSize = CGSizeMake(375*5, 0);
    //取消边界反弹效果
    self.myscro.bounces = NO;
    //是否限时垂直滚动条
    self.myscro.showsHorizontalScrollIndicator = YES;

    
 
//    self.label1 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 375, 188)];
//    self.label1.backgroundColor = [UIColor redColor];
//    self.label2 = [[UILabel alloc]initWithFrame:CGRectMake(375, 0, 375, 188)];
//    self.label2.backgroundColor = [UIColor yellowColor];
//    self.label3 = [[UILabel alloc]initWithFrame:CGRectMake(750, 0, 375, 188)];
//    self.label3.backgroundColor = [UIColor blueColor];
//    self.label4 = [[UILabel alloc]initWithFrame:CGRectMake(1125, 0, 375, 188)];
//    self.label4.backgroundColor = [UIColor blackColor];
//    self.label5 = [[UILabel alloc]initWithFrame:CGRectMake(1500, 0, 375, 188)];
//    self.label5.backgroundColor =[UIColor brownColor];

    
    self.tupian = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 375, 188)];
    self.tupian1 = [[UIImageView alloc]initWithFrame:CGRectMake(375, 0, 375, 188)];
    self.tupian2 = [[UIImageView alloc]initWithFrame:CGRectMake(750, 0, 375, 188)];


//    [self.label1 addSubview:self.tupian];
//    [self.label2 addSubview:self.tupian];
//    [self.label3 addSubview:self.tupian];
    
    
    
//    [self.myscro addSubview:self.label2];
//    [self.myscro addSubview:self.label3];
//    [self.myscro addSubview:self.label4];
//    [self.myscro addSubview:self.label5];

    [self.myscro addSubview:self.tupian];
    [self.myscro addSubview:self.tupian1];
    
    [self.myscro addSubview:self.tupian2];

    
    
//    for (int i = 0; i < 4; i++) {
//        UIScrollView *scroll = [[UIScrollView alloc]initWithFrame:self.contentView.bounds];
////        NSString *name = [NSString stringWithFormat:@""]
////        imageView.image = [UIImage imageNamed:@""];
//     
//        
//        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 375, 667)];
//        imageView.image = self.tupian.image;
//        
//        scroll.frame = CGRectMake(375*i, 0, 375, 667);
// 
//        [scroll addSubview:imageView];
//        [self.myscro addSubview:scroll];
//        [scroll release];
//      
//    }
//    UIPageControl *pageC = [[UIPageControl alloc]initWithFrame:CGRectMake(130, 160, 100, 10)];
//    [self.contentView addSubview:pageC];
//    pageC.numberOfPages = 5;
//    pageC.currentPageIndicatorTintColor = [UIColor yellowColor];
//    pageC.pageIndicatorTintColor = [UIColor blackColor];
//    //设置当前显示的页码是多少
//    pageC.currentPage = 0;
//    pageC.tag = 101;
    
    
}
-(void)setLunmo:(LunMoTu *)lunmo{
    if (_lunmo != lunmo) {
        [_lunmo release];
        _lunmo = [lunmo retain];
    }
    NSURL *url = [NSURL URLWithString:_lunmo.imgsrc];
    [self.tupian sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"h1"]];
    [self.tupian1 sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"h1"]];
    [self.tupian2 sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"h1"]];


//    NSURL *url1 = [NSURL URLWithString:_lunmo.imgsrc];
//    [self.tupian1 sd_setImageWithURL:url1 placeholderImage:[UIImage imageNamed:@"h1"]];
//    NSLog(@"****%@",self.tupian);

}


@end
